package com.pingan.haofang.searchcloud.metadata.dao;

import com.pingan.haofang.searchcloud.collection.domain.Collection;
import com.pingan.haofang.searchcloud.metadata.domain.Metadata;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

/**
 * 索引元数据信息DAO
 *
 * @author baojie371
 * @date 17/5/3
 * @since 1.0.0
 */
public interface MetadataDao extends JpaRepository<Metadata, Long> {

    List<Metadata> findByStatusAndIndexIdIn(int status, Iterable<Long> indexIds);

    List<Metadata> findFirst1ByIndexIdOrderByConfigVersionDesc(long indexId);

    List<Metadata> findByIndexIdAndStatusOrderByIdDesc(long indexId, int status);

    List<Metadata> findByStatus(int status);


    List<Metadata> findByConfigNameAndConfigVersion(String configName, Integer configVersion);

    List<Metadata> findByIndexIdAndStatusIn(Long id, List<Integer> unDelStatusIds);

}

